﻿using SLClient.CustomerControls;
using SLClient.Extension;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;

namespace SLClient.Views
{
    public partial class Zx3DView : Page
    {
        public int lotteryCatagoryId;

        public Zx3DView()
        {
            PlayDataInfo sdData;
            this.lotteryCatagoryId = 2;
            this.InitializeComponent();
            if (!IsolatedStorageHelper<PlayDataInfo>.IsSettingPersisted("sd"))
            {
                sdData = new PlayDataInfo(this.lotteryCatagoryId, "sd");
            }
            else if (ViewDispatcher.SdData.CurrentPlayData.OpenTime <= DateTime.Now)
            {
                sdData = new PlayDataInfo(this.lotteryCatagoryId, "sd");
            }
            else
            {
                sdData = ViewDispatcher.SdData;
            }
            BonusControl bonuscontrol = new BonusControl(sdData);
            this.gridUp.Children.Add(bonuscontrol);
            bonuscontrol.SetValue(FrameworkElement.HorizontalAlignmentProperty, (HorizontalAlignment)0);
            bonuscontrol.SetValue(FrameworkElement.VerticalAlignmentProperty, (VerticalAlignment)0);
            LastOpenDataControl control2 = new LastOpenDataControl(sdData);
            this.gridUp.Children.Add(control2);
            control2.SetValue(Grid.ColumnProperty, 1);
            control2.SetValue(FrameworkElement.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
            Top10WinnerControl control3 = new Top10WinnerControl(sdData);
            this.gridDown.Children.Add(control3);
            control3.SetValue(FrameworkElement.HorizontalAlignmentProperty, (HorizontalAlignment)2);
            control3.SetValue(FrameworkElement.VerticalAlignmentProperty, (VerticalAlignment)0);
            control3.SetValue(Grid.ColumnProperty, 1);
            this.m_BetControl.InitPage(StringResource.Zx3D, new BetPlayTypeInfo[] { new BetPlayTypeInfo(9, "3D直选", new BetPlayInfo[] { new BetPlayInfo(0x26, "3D直选复式", 0, 1, 3, 0, true), new BetPlayInfo(40, "3D直选单式", 0, 0, 3, 0, true) }), new BetPlayTypeInfo(10, "3D组选", new BetPlayInfo[] { new BetPlayInfo(0x29, "3D组选组六", 1, 1, 1, 0, true), new BetPlayInfo(0x2a, "3D组选组三", 1, 1, 1, 0, true), new BetPlayInfo(0x2b, "3D组选混合", 4, 0, 3, 0, true) }), new BetPlayTypeInfo(11, "后二直选", new BetPlayInfo[] { new BetPlayInfo(0x2c, "后二直选复式", 0, 1, 2, 1, true), new BetPlayInfo(0x2d, "后二直选单式", 0, 0, 2, 1, true) }), new BetPlayTypeInfo(12, "后二组选", new BetPlayInfo[] { new BetPlayInfo(0x2e, "后二组选组二", 1, 1, 1, 1, true), new BetPlayInfo(0x2f, "后二组选混合", 4, 0, 2, 1, true) }), new BetPlayTypeInfo(13, "后一直选", new BetPlayInfo[] { new BetPlayInfo(0x30, "后一直选复式", 0, 1, 1, 2, true) }), new BetPlayTypeInfo(14, "不定位胆", new BetPlayInfo[] { new BetPlayInfo(50, "3D不定位胆", 2, 1, 1, 0, true) }), new BetPlayTypeInfo(15, "定位胆", new BetPlayInfo[] { new BetPlayInfo(0x33, "定位胆", 3, 1, 3, 0, true) }) }, bonuscontrol, this.lotteryCatagoryId);
        }       
    }
}
